#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/rope>
#define rep(i,l,r) for(int i=(l),i##end=(r);i<=i##end;++i)
#define per(i,r,l) for(int i=(r),i##end=(l);i>=i##end;--i)
#define int long long
#define double long double
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define rbtree(way) tree<way,null_type,less<way>,rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
const int maxn=1e6+10,maxm=1e6+10,mod=998244353,inf=INT_MAX;
inline int ksm(int x,int k,int mod=mod){
	int ans=1;
	for(;k;k>>=1,x=x*x%mod) if(k&1) ans=ans*x%mod;
	return ans;
}

int T,n,ans;

signed main(){
	freopen("tree.in","r",stdin),freopen("tree.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>T;
	rep(o,1,T){
		cin>>n;
		if(n==0){
			cout<<2<<'\n';
			continue;
		}
		for(int l=0,r=2e9+10,mid;l<=r;mid=l+r>>1,n<=(mid-1)*(mid-1)/4?ans=mid,r=mid-1:l=mid+1);
		if(ans%2==0&&n%2==1) ++ans;
		cout<<ans<<'\n';
	}
	return 0;
}
